import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 餐车和盒配置信息 */
export interface RobotBox {
          id: number; // ID
          robotSn: string; // 机器人SN
          boxNo?: string; // 编号
          foodSize?: number; // 支持食品数
          boxDirect?: string, //餐盒方向L左 R右
          sort?: number; // 排序
  }

// 餐车和盒配置 API
export const RobotBoxApi = {
  // 查询餐车和盒配置分页
  getRobotBoxPage: async (params: any) => {
    return await request.get({ url: `/rbt/robot-box/page`, params })
  },

  // 查询餐车和盒配置详情
  getRobotBox: async (id: number) => {
    return await request.get({ url: `/rbt/robot-box/get?id=` + id })
  },

  // 新增餐车和盒配置
  createRobotBox: async (data: RobotBox) => {
    return await request.post({ url: `/rbt/robot-box/create`, data })
  },

  // 修改餐车和盒配置
  updateRobotBox: async (data: RobotBox) => {
    return await request.put({ url: `/rbt/robot-box/update`, data })
  },

  // 删除餐车和盒配置
  deleteRobotBox: async (id: number) => {
    return await request.delete({ url: `/rbt/robot-box/delete?id=` + id })
  },

  /** 批量删除餐车和盒配置 */
  deleteRobotBoxList: async (ids: number[]) => {
    return await request.delete({ url: `/rbt/robot-box/delete-list?ids=${ids.join(',')}` })
  },

  // 导出餐车和盒配置 Excel
  exportRobotBox: async (params) => {
    return await request.download({ url: `/rbt/robot-box/export-excel`, params })
  }
}
